# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=iddawc
pkgver=1.1.8
pkgrel=1
pkgdesc='OAuth2 and OIDC client library'
arch=(loong64 x86_64)
url=https://github.com/babelouest/iddawc
license=(LGPL2.1)
depends=(
  glibc
  liborcania.so
  librhonabwy.so
  libulfius.so
  libyder.so
)
makedepends=(
  cmake
  doxygen
  git
  graphviz
  ninja
  systemd
)
provides=(libiddawc.so)
_tag=5dff66e6495532728beadadb294a93c91a450aee
source=(git+https://github.com/babelouest/iddawc.git#tag=${_tag})
validpgpkeys=(8405B02FCC28EF9744C8F253FE82139440BD22B9) # Nicolas Mora <nicolas@babelouest.org>
b2sums=(SKIP)

pkgver() {
  cd iddawc
  git describe --tags | sed 's/^v//'
}

build() {
  export CFLAGS+=" -Wno-maybe-uninitialized"
  cmake -S iddawc -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_IDDAWC_DOCUMENTATION=ON
  ninja -C build doc
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
  install -dm 755 "${pkgdir}"/usr/share/doc/iddawc
  cp -dr --no-preserve=ownership iddawc/doc/html "${pkgdir}"/usr/share/doc/iddawc/
}

# vim: ts=2 sw=2 et:
